Optimal. Leaf size=38 \[ a^2 x+\frac {2 a b x^{n+1}}{n+1}+\frac {b^2 x^{2 n+1}}{2 n+1} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.01, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {244} \[ a^2 x+\frac {2 a b x^{n+1}}{n+1}+\frac {b^2 x^{2 n+1}}{2 n+1} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 244
Rubi steps
\begin {align*} \int \left (a+b x^n\right )^2 \, dx &=\int \left (a^2+2 a b x^n+b^2 x^{2 n}\right ) \, dx\\ &=a^2 x+\frac {2 a b x^{1+n}}{1+n}+\frac {b^2 x^{1+2 n}}{1+2 n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 34, normalized size = 0.89 \[ x \left (a^2+\frac {2 a b x^n}{n+1}+\frac {b^2 x^{2 n}}{2 n+1}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.04, size = 65, normalized size = 1.71 \[ \frac {{\left (b^{2} n + b^{2}\right )} x x^{2 \, n} + 2 \, {\left (2 \, a b n + a b\right )} x x^{n} + {\left (2 \, a^{2} n^{2} + 3 \, a^{2} n + a^{2}\right )} x}{2 \, n^{2} + 3 \, n + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.17, size = 73, normalized size = 1.92 \[ \frac {2 \, a^{2} n^{2} x + b^{2} n x x^{2 \, n} + 4 \, a b n x x^{n} + 3 \, a^{2} n x + b^{2} x x^{2 \, n} + 2 \, a b x x^{n} + a^{2} x}{2 \, n^{2} + 3 \, n + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 41, normalized size = 1.08 \[ \frac {2 a b x \,{\mathrm e}^{n \ln \relax (x )}}{n +1}+\frac {b^{2} x \,{\mathrm e}^{2 n \ln \relax (x )}}{2 n +1}+a^{2} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.49, size = 38, normalized size = 1.00 \[ a^{2} x + \frac {b^{2} x^{2 \, n + 1}}{2 \, n + 1} + \frac {2 \, a b x^{n + 1}}{n + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.18, size = 36, normalized size = 0.95 \[ a^2\,x+\frac {b^2\,x\,x^{2\,n}}{2\,n+1}+\frac {2\,a\,b\,x\,x^n}{n+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.47, size = 182, normalized size = 4.79 \[ \begin {cases} a^{2} x + 2 a b \log {\relax (x )} - \frac {b^{2}}{x} & \text {for}\: n = -1 \\a^{2} x + 4 a b \sqrt {x} + b^{2} \log {\relax (x )} & \text {for}\: n = - \frac {1}{2} \\\frac {2 a^{2} n^{2} x}{2 n^{2} + 3 n + 1} + \frac {3 a^{2} n x}{2 n^{2} + 3 n + 1} + \frac {a^{2} x}{2 n^{2} + 3 n + 1} + \frac {4 a b n x x^{n}}{2 n^{2} + 3 n + 1} + \frac {2 a b x x^{n}}{2 n^{2} + 3 n + 1} + \frac {b^{2} n x x^{2 n}}{2 n^{2} + 3 n + 1} + \frac {b^{2} x x^{2 n}}{2 n^{2} + 3 n + 1} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________